import { createRouter, createWebHashHistory } from 'vue-router'

const Layout = () =>
    import ('@/views/layout.vue')
const Home = () =>
    import ('@/views/home')
const Login = () =>
    import ('@/views/login/Login')
const routes = [{
            path: '/',
            component: Layout,
            children: [
                { path: '/', component: Home }
            ]
        },
        { path: '/login', component: Login }
    ]
    // vue2.0 vueRouter({})创建路由实例
    // vue3.0 createRoouter({}) 创建路由实例
const router = createRouter({
    // hash
    history: createWebHashHistory(),
    routes
})

export default router